<template>
  <div>
    <ul>
      <li v-for="item in books" :key="item._id">{{item.title}}</li>
    </ul>
  </div>
</template>

<script>
const db = wx.cloud.database();
export default {
  data() {
    return {
      books: []
    };
  },
  created() {
  },
  methods: {
    async getBooks() {
      const books = await db.collection("yidianBook").get();
      this.books = books.data;
      // console.log(books.data);
    }
  }
};
</script>

<style>
</style>